package com.modules.controller.sys;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.common.controller.MyController;
import com.common.vo.Result;
import com.modules.entity.sys.LogEntity;
import com.modules.service.sys.LogService;


/**
 * 日志
 * @author yyq
 *
 */
@Controller
@RequestMapping("/sys/log")
public class LogControl extends MyController<LogEntity>{

	@Autowired
	private LogService service;
	
	
	/**
	 * 查询
	 * @param request
	 * @return
	 */
	@GetMapping(value = "/select")
	@ResponseBody
	public Result<?> select(LogEntity log){
		if(log.getOid() == null) {
			log.setOid(getUser().getLastOid());
		}
		IPage<LogEntity> iPage = service.page(getPage(), new LambdaQueryWrapper<LogEntity>());
		return Result.success(iPage.getRecords(), iPage.getTotal());
	}
	

}
